package JavaSEAdvance.day10_MapAndStream;

/**
 * @author Xiao
 * @date 2021/7/28
 */
public class VariableParameterDemo01 {
    /**
     * 需求：
     * 求任意个整数的和
     */
    public static void main(String[] args) {
        System.out.println(getSum(1,3,5,7,9));
    }

    public static int getSum(int... arr) {
        int sum = 0;
        for (int i : arr) {
            sum += i;
        }
        return sum;
    }
}
